﻿<?php
session_start();
$db="eckien";
$dbuser="root";
$dbpass="";
$host="localhost";
$table="user";
$con=mysql_connect($host,$dbuser,$dbpass) or die("Không thể kết nối cơ sở dữ liệu");
mysql_select_db($db, $con);
function checklogin(){ 
	if(isset($_COOKIE["login"]))
	{
	  $user=$_COOKIE["login"];
	  if(isset($_SESSION[$user])){
	    $codeSession=$_SESSION[$user];
		$codeCookie=$_COOKIE[$user];
		if($codeSession==$codeCookie)
		return 1;
	  }
	  else return 2;
	}
	else  return 2;
}
?> 
<html>
<head>
	<title> Quản lý bán đấu giá</title>
	<meta name="keywords" content="C503007">
	<meta name="description" content="1 2 3">
	<meta name="chikien" content="Võ Nguyên Huy, Vũ Văn Hà">
	<link rel="stylesheet" type="text/css" href="style.css"/>
	<script type="text/javascript" src="jquery.js"></script>
		
</head>
<body vlink="#000" alink="#000" link="#000" >
	<div id="header">
		<div id="topH">
		</div>
		<div id="menuBar">
			<div id="menu">
				<div id="tc" onclick="menuClick(0)" ><table><th><a href="index.php" >Trang Chủ</a></table></th></div>
				<div id="dg"  onclick="menuClick(1)"><table><th><a href="auction.php">Đấu giá</a></table><th></div>
				<div id="tcn"  onclick="menuClick(2)"><table><th><a href="profile.php">Trang cá nhân</a></table></th></div>
				<?php if(checklogin()==2){
      				echo("<div id='reg' ><a href='reg.php' ><table><th>Đăng kí</table></a></div>");
				}
				if(checklogin()==1)
				    echo("<div id='logout' ><a href='logout.php' ><table><th>Đăng xuất</table></a></div>");
				?>
			</div>
			<div id="sub">
			</div>
		</div>
	</div>
	
<div id="mainBody">
  <div id="body1">
  